package exception_homework2;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了..");
        try (FileOutputStream fos = new FileOutputStream("fos1.txt"))
        {
            fos.write(1);
            System.out.println(fos);
        }
        catch (IOException e){
            System.out.println("捕获了异常并解决了..");
        }
        System.out.println("程序结束了..");
    }
}
